MPI_COMPILE_FLAGS = $(shell mpicc --showme:compile)
MPI_LINK_FLAGS = $(shell mpicc --showme:link) -fopenmp
OMP_FLAGS = -fopenmp

all: seq mpi mpi-omp omp

seq: JR.c
	gcc JR.c -o JR

mpi: JR-MPI.c
	mpicc JR-MPI.c -o JR-MPI

mpi-omp: JR-MPI-OMP.c
	gcc $(MPI_COMPILE_FLAGS) JR-MPI-OMP.c -o JR-MPI-OMP $(MPI_LINK_FLAGS)

omp: JR-OMP.c
	gcc JR-OMP.c -o JR-OMP $(OMP_FLAGS)
